<template>
  <div class="my-counter">
    <button type="button" class="btn btn-light" @click="$emit('cutCount',item.id)">-</button>
    <input type="number" class="form-control inp"  v-model.number="inputVal"  @blur="$emit('inputNum',inputVal,item.id)">
    <button type="button" class="btn btn-light" @click="$emit('addCount',item.id)">+</button>
  </div>
</template>

<script>
// value="item.goods_count"
// v-model.number="inputVal"
export default {
  props:{
    item : Object,
    
  },
  data(){
    return {
      inputVal:this.item.goods_count,
    }
  },
  methods:{
    
  }

}
</script>

<style lang="less" scoped>
.my-counter {
  display: flex;
  .inp {
    width: 45px;
    text-align: center;
    margin: 0 10px;
  }
  .btn, .inp{
    transform: scale(0.9);
  }
}
</style>